package net.homelinux.chaoswg.io.renga.krypto.datatypes.numerical;

import java.math.BigInteger;

public class Unsigned16Bit extends UnsignedNBit {
    public static final BigInteger MAX = new BigInteger ("65535");
    public static final BigInteger MOD = MAX.add(new BigInteger("1"));
    public static final int n = 16;        

    public Unsigned16Bit () {
        initRanges ();
    }

    public Unsigned16Bit (final BigInteger value) {
        initRanges ();

        if (value.compareTo(MIN) < 0 || value.compareTo(MAX) > 0) {
            throw new IllegalArgumentException ();
        } else {
            this.value = value;
        }
    }

    public Unsigned16Bit (final Unsigned16Bit u16b) {
        initRanges ();
        this.value = u16b.value;
    }
    
    private void initRanges () {
    }

    public BigInteger getMAX () {
        return MAX; 
    }
    
    public BigInteger getMOD () {
        return MOD;
    }
    
    public int getN () {
        return n;
    }
}
